1. Field of the Invention
The invention relates to the technical field of image coding and, more particularly, to a coding method and system with an adaptive bitplane coding mode.
2. Description of Related Art
An image coding typically compresses an entire frame by dividing the frame into macroblocks and compressing each of the macroblocks. To achieve a higher compression ratio, the macroblocks may be compressed by different macroblock modes, depending on the attributes thereof. Therefore, in a compressed or coded bit stream, each macroblock requires several fields to indicate the macroblock mode used in the macroblock, for example, Skipped MB/Not Skipped, 1MV/4MV, AC prediction, Direct Mode/Not Direct Mode, or the like. In the VC-1 standard, a bitplane coding mode is provided to further compress the macroblock mode of each macroblock to thereby achieve a higher compression ratio.
In the VC-1 (WMV) image coding, a frame is divided into multiple macroblocks, and the coding modes for every macroblock are combined into multiple bitplanes. Namely, each bitplane consists of macroblock modes used by a macroblock of the frame, and is coded in accordance with the VC-1 (WMV) image coding standard, thereby obtaining a preferred compression efficiency.
The bitplane coding mode can be divided into raw mode and compress mode. FIG. 1 is a schematic diagram of typical bitplanes of the coding system at the compress mode. As shown in FIG. 1, the macroblock modes output by a first macroblock mode determinator 120 and a second macroblock mode determinator 150 are temporarily stored in a second buffer 130. Having constructed multiple bitplanes, a compression operation is performed on the bitplanes. In addition, the compressed data of the macroblocks is temporarily stored in a first buffer 140. Finally, the compressed bitplane and the compressed macroblocks are combined into a bit stream. In this case, the combined bitplane is located in the frame header of the bit stream. FIG. 2 is a schematic diagram of typical bitplanes of the coding system in the raw mode. As shown in FIG. 2, each macroblock mode, which is not compressed, is temporarily stored in a second buffer 130. The non-compressed macroblock modes are combined with the compressed macroblocks. In this case, the data of each macroblock mode is located in the macroblock header of the macroblock corresponding to the macroblock mode. However, such a way requires a bit steam produced after every macroblock is temporarily stored and compressed, and the location of each compressed macroblock in the bit stream. In addition, the additional time for transferring data is required, which causes a poor efficiency. Therefore, there is a need to provide an improvement relating to coding method and system for the above bitplane coding mode.